From: Florian Müllner Date: Wed, 5 Apr 2023 14:02:29 +0000 (+0200) Subject: st/icon-theme: Fix transparent colors in symbolic SVGs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1ca5fc7de1a925cc830c35d0c9ae0abd9a0d3572;p=gnome-shell.git st/icon-theme: Fix transparent colors in symbolic SVGs When loading a symbolic SVG, the original file is wrapped in a header that includes a generated stylesheet with the appropriate colors, plus an overall opacity. The opacity value is clamped to values between 0 and 1, which directly matched the alpha field of the GdkRGBA type. However since we moved to StIconColors/ClutterColor, the alpha field is now in the range [0..255], any alpha value other than 0 now results in full opacity. To fix, translate the [0..255] integer into a [0..1] double before using it as opacity. Part-of: --- diff --git a/src/st/st-icon-theme.c b/src/st/st-icon-theme.c index d6f68afbb..9edde5c77 100644 --- a/src/st/st-icon-theme.c +++ b/src/st/st-icon-theme.c @@ -3802,7 +3802,7 @@ st_icon_info_load_symbolic_svg (StIconInfo *icon_info, double alpha; char alphastr[G_ASCII_DTOSTR_BUF_SIZE]; - alpha = colors->foreground.alpha; + alpha = colors->foreground.alpha / 255.; css_fg = color_to_string_noalpha (&colors->foreground);